using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Iacym.Entities;

namespace Iacym.Repository.Mapping
{
    public class DETALLE_CITAMap : EntityTypeConfiguration<DETALLE_CITA>
    {
        public DETALLE_CITAMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.Temas)
                .IsRequired();

            // Table & Column Mappings
            this.ToTable("DETALLE_CITA");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.AgendaId).HasColumnName("AgendaId");
            this.Property(t => t.Temas).HasColumnName("Temas");
            this.Property(t => t.Conclusion).HasColumnName("Conclusion");

            // Relationships
            this.HasRequired(t => t.Agendum)
                .WithMany(t => t.DETALLE_CITA)
                .HasForeignKey(d => d.AgendaId);

        }
    }
}
